#include<iostream>
using namespace std;
#include"sort.h"

void Test1()
{
	int array[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	for (auto e : array)
	{
		cout << e << " ";
	}
	cout << endl;
	cout << IsHeap(array,10) << endl;
	AdjustDown1(array, 0, 10);
	for (auto e : array)
	{
		cout << e << " ";
	}
	cout << endl;
	cout << IsHeap(array, 10) << endl;
}
void Test2()
{
	int array[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	HeapInit(array, 10);
	for (auto e : array)
	{
		cout << e << " ";
	}
	cout << endl;
	cout << IsHeap(array,10) << endl;
}
void Test3()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	InsertSort2(array1, 10);
	InsertSort2(array2, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test4()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	ShellSort(array1, 10);
	ShellSort(array2, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test5()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	SelectSort(array1, 10);
	SelectSort(array2, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test6()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	HeapSort(array1, 10);
	HeapSort(array2, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test7()
{
	int array1[] = {27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	BubbleSort(array1, 10);
	BubbleSort(array2, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test8()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };

	QuickSortR(array1, 10);
	QuickSortR(array2, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test9()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	int array3[] = { 10, 5, 14, 10, 69, 11, 17, 19, 10, 10 };
	QuickSort(array1, 10);
	QuickSort(array2, 10);
	QuickSort(array3, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array3)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test10()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25 };
	int array3[] = { 10, 5, 14, 10, 69, 11, 17, 19, 10, 10 };
	MergeSortR(array1, 10);
	MergeSortR(array2, 10);
	MergeSortR(array3, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array3)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test11()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25, 17 };
	int array3[] = { 10, 5, 14, 10, 69, 11, 17, 19, 10, 10 };
	MergeSort(array1, 10);
	MergeSort(array2, 11);
	MergeSort(array3, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array3)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test12()
{
	int array1[] = { 27, 15, 19, 18, 28, 34, 65, 49, 25, 37 };
	int array2[] = { 2, 15, 4, 11, 12, 31, 20, 13, 14, 25, 17 };
	int array3[] = { 10, 5, 14, 10, 69, 11, 17, 19, 10, 10 };
	CountSort(array1, 10);
	CountSort(array2, 11);
	CountSort(array3, 10);
	for (auto e : array1)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array2)
	{
		cout << e << " ";
	}
	cout << endl;
	for (auto e : array3)
	{
		cout << e << " ";
	}
	cout << endl;
}
int main()
{
	Test12();
	//Test11();
	//Test10();
	//Test9();
    //Test8();
	//Test7();
	//Test6();
	//Test5();
	//Test4();
	//Test3();
	//Test2();
	//Test1();
	return 0;
}